import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'
import { META_VISIBLE } from "@/utils/constants"

// 路由配置 process.env.VUE_APP_NAME
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: 'exception',
      name: '异常页',
      meta: {
        icon: 'warning',
      },
      component: BlankView,
      children: [
        {
          path: '404',
          name: 'Exp404',
          component: () => import('@/pages/exception/404')
        },
        {
          path: '403',
          name: 'Exp403',
          component: () => import('@/pages/exception/403')
        },
        {
          path: '500',
          name: 'Exp500',
          component: () => import('@/pages/exception/500')
        }
      ]
    },

    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'home',
          name: '系统概览',
          meta: {
            icon: 'home'
          },
          component: () => import('@/pages/Home')
        },
        {
          path: 'spread',
          name: '数据展示',
          meta: {
            icon: 'area-chart'
          },
          component: PageView,
          children: [
            /*  {
               path: 'echarts',
               name: '图表展示',
               component: () => import('@/pages/spread/echarts')
             }, */
            {
              path: 'surelyTable',
              name: '数据展示列表',
              component: () => import('@/pages/spread/surelyTable')

            },
            {
              path: 'surelyInfo',
              name: '详情',
              meta: {
                icon: '菜单图标',
                invisible: true,
              },
              component: () => import('@/pages/spread/surelyTable/surelyInfo'),
             
            }
          ],

        },
        {
          path: 'distribution',
          name: '图表展示',
          meta: {
            icon: 'dot-chart'
          },
          component: PageView,
          // component: () => import('@/pages/distribution'),
          children: [
            {
              path: 'distribution',
              name: '数据分布',      
                   
              component: () => import('@/pages/distribution')
            },           
            {
              path: 'datastatistics',
              name: '数据统计',              
              component: () => import('@/pages/distribution/datastatistics')
            },
            
          ]
        },
        {
          path: 'atlasdistribution',
          name: '图谱分析',
          meta: {
            icon: "radar-chart"
          },         
          component: PageView,
          children: [
            {
              path: 'mixedSplitting',
              name: '混合拆分',
              component: () => import('@/pages/atlasdistribution/mixedSplitting')
            },
            {
              path: 'lrTest',
              name: 'LR检验',
              component: () => import('@/pages/atlasdistribution/lrTest')
            }
          ]
        },
        {
          path: 'SystemSettings',
          name: '系统管理',
          meta: {
            icon: 'setting'
          },
          component: PageView,
          children: [
            {
              path: 'RoleManagement',
              name: '角色管理',
              meta: {
                /* page: {
                  closable: false
                } */
              },
              component: () => import('@/pages/SystemSettings/RoleManagement'),
            },
            {
              path: 'UserManagement',
              name: '用户管理',
              component: () => import('@/pages/SystemSettings/UserManagement'),
            },
            {
              path: 'PersonManagement',
              name: '个人信息管理',
              component: () => import('@/pages/SystemSettings/PersonManagement'),
            }
          ]
        },
        {
          path: 'help',
          name: '帮助',
          meta: {
            icon: "question-circle"
          },
          component: () => import('@/pages/help')
        },
        {
          path: 'dashboard',
          name: 'dashboard',
          meta: {
            icon: 'dashboard',
            invisible: META_VISIBLE
          },
          component: BlankView,
          children: [
            {
              path: 'workplace',
              name: '工作台',
              meta: {
                page: {
                  closable: false
                }
              },
              component: () => import('@/pages/dashboard/workplace'),
            },
            {
              path: 'analysis',
              name: '分析页',
              component: () => import('@/pages/dashboard/analysis'),
            }
          ]
        },
        {
          path: 'form',
          name: '表单页',
          meta: {
            icon: 'form',
            invisible: META_VISIBLE,
            page: {
              cacheAble: false,
            }
          },
          component: PageView,
          children: [
            {
              path: 'basic',
              name: '基础表单',
              component: () => import('@/pages/form/basic'),
            },
            {
              path: 'step',
              name: '分步表单',
              component: () => import('@/pages/form/step'),
            },
            {
              path: 'advance',
              name: '高级表单',
              component: () => import('@/pages/form/advance'),
            }
          ]
        },
        {
          path: 'list',
          name: '列表页',
          meta: {
            icon: 'table',
            invisible: META_VISIBLE
          },
          component: PageView,
          children: [
            {
              path: 'query',
              name: '查询表格',
              meta: {
                authority: 'queryForm',
              },
              component: () => import('@/pages/list/QueryList'),
            },
            {
              path: 'query/detail/:id',
              name: '查询详情',
              meta: {
                highlight: '/list/query',
                invisible: true
              },
              component: () => import('@/pages/Demo')
            },
            {
              path: 'primary',
              name: '标准列表',
              component: () => import('@/pages/list/StandardList'),
            },
            {
              path: 'card',
              name: '卡片列表',
              component: () => import('@/pages/list/CardList'),
            },
            {
              path: 'search',
              name: '搜索列表',
              component: () => import('@/pages/list/search/SearchLayout'),
              children: [
                {
                  path: 'article',
                  name: '文章',
                  component: () => import('@/pages/list/search/ArticleList'),
                },
                {
                  path: 'application',
                  name: '应用',
                  component: () => import('@/pages/list/search/ApplicationList'),
                },
                {
                  path: 'project',
                  name: '项目',
                  component: () => import('@/pages/list/search/ProjectList'),
                }
              ]
            }
          ]
        },
        {
          path: 'details',
          name: '详情页',
          meta: {
            icon: 'profile',
            invisible: META_VISIBLE
          },
          component: BlankView,
          children: [
            {
              path: 'basic',
              name: '基础详情页',
              component: () => import('@/pages/detail/BasicDetail')
            },
            {
              path: 'advance',
              name: '高级详情页',
              component: () => import('@/pages/detail/AdvancedDetail')
            }
          ]
        },
        {
          path: 'result',
          name: '结果页',
          meta: {
            icon: 'check-circle-o',
            invisible: META_VISIBLE
          },
          component: PageView,
          children: [
            {
              path: 'success',
              name: '成功',
              component: () => import('@/pages/result/Success')
            },
            {
              path: 'error',
              name: '失败',
              component: () => import('@/pages/result/Error')
            }
          ]
        },

        {
          path: 'components',
          name: '内置组件',
          meta: {
            invisible: META_VISIBLE,
            icon: 'appstore-o'
          },
          component: PageView,
          children: [
            {
              path: 'taskCard',
              name: '任务卡片',
              component: () => import('@/pages/components/TaskCard')
            },
            {
              path: 'palette',
              name: '颜色复选框',
              component: () => import('@/pages/components/Palette')
            },
            {
              path: 'table',
              name: '高级表格',
              component: () => import('@/pages/components/table')
            }
          ]
        },
        {
          name: '验权表单',
          path: 'auth/form',
          meta: {
            icon: 'file-excel',
            invisible: META_VISIBLE,
            authority: {
              permission: 'form'
            }
          },
          component: () => import('@/pages/form/basic')
        },
        {
          name: '带参菜单',
          path: 'router/query',
          meta: {
            invisible: META_VISIBLE,
            icon: 'project',
            query: {
              name: '菜单默认参数'
            }
          },
          component: () => import('@/pages/Demo')
        },
        {
          name: '动态路由菜单',
          path: 'router/dynamic/:id',
          meta: {
            icon: 'project',
            invisible: META_VISIBLE,
            params: {
              id: 123
            }
          },
          component: () => import('@/pages/Demo')
        },
        {
          name: 'Ant Design Vue',
          path: 'antdv',
          meta: {
            invisible: META_VISIBLE,
            icon: 'ant-design',
            link: 'https://www.antdv.com/docs/vue/introduce-cn/'
          }
        },
        {
          name: '使用文档',
          path: 'document',
          meta: {
            invisible: META_VISIBLE,
            icon: 'file-word',
            link: 'https://iczer.gitee.io/vue-antd-admin-docs/'
          }
        }
      ]
    },
  ]
}

export default options
